<!-- 云诺 https://app.witframe.com/market/list/index?uid=24 -->
<template>
	<view>
		<u-tabbar :value="currentTab" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" :activeColor="activeColor" zIndex='1000'>
			<u-tabbar-item text="首页" icon="home" name="home" @click="handTab(0)"></u-tabbar-item>
			<u-tabbar-item text="产品" icon="tags" name="product" @click="handTab(1)"></u-tabbar-item>
			<u-tabbar-item text="资讯" icon="list-dot" name="news" @click="handTab(2)"></u-tabbar-item>
			<u-tabbar-item text="案例" icon="file-text" name="case" @click="handTab(3)"></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		name: "yn-tabbar",
		props: {
			currentTab: {
				type: String,
				default: 'home'
			}
		},
		data() {
			return {
				switchTab: [
					"/pages/index/index",
					"/pages/product/product",
					"/pages/news/news",
					"/pages/case/case"
				],
				activeColor: '#2d96ff',
				minappinfo:[]
			};
		},
		mounted() {
			this.minappinfo = uni.getStorageSync('minappinfo');
			if(this.minappinfo.bgColor){
				this.activeColor = this.minappinfo.bgColor;
			}
		},
		methods: {
			handTab(index) {
				uni.switchTab({
					url: this.switchTab[index]
				})
			}
		}
	}

</script>

<style>

</style>

